package com.fjp.heartguard.viewmodel

import androidx.databinding.ObservableField
import androidx.lifecycle.MutableLiveData
import com.fjp.heartguard.app.base.HTBaseViewModel
import com.fjp.heartguard.app.data.bean.Message
import com.fjp.heartguard.app.network.HttpRequestCoroutine
import me.hgj.jetpackmvvm.ext.request
import me.hgj.jetpackmvvm.state.ResultState

class MessageDetailViewModel : HTBaseViewModel() {
    val messageResult = MutableLiveData<ResultState<Message>>()
    val message = ObservableField<Message>()

    fun getMessageDetail(id: Int) {
        request({
            HttpRequestCoroutine.getMessageDetail(id)
        }, messageResult, false)

    }
}